CustomerInfoGridCtl = Ext.extend(CustomerGridCtl, {

			getCommonConfig : function() {

				var config = {
					region : 'center'
				};

				return config;

			},
			configButtons : function(config) {
				
				var buttons = [{
							text : '添加',
							handler : this.add,
							scope : this
						}, {
							text : '修改',
							handler : this.edit,
							scope : this
						}, {
							text : '删除',
							handler : this.del,
							scope : this
						}, {
							text : '导出',
							handler : this.exp,
							scope : this
						}, {
							text : '查看详细信息',
							handler : this.showDetail,
							scope : this
						}];

				// var gcc = cf.getC('gcc');

				config.buttonAlign = 'left';
				config.buttons = buttons;

				return config;

			},
			add : function() {

				var cawc = cf.getC('cawc');
				cawc.show();
			},
			edit : function() {
				var cawc = cf.getC('cawc');
				var cafc = cf.getC('cafc');

				var record = this.getSelectedRecord();
				if (!record) {
					alert('请先选择一条记录！');
					return;
				}

				var status = record.get("status");
				
				if (!((status == 0) || (status == 4))) {
					alert('只有保存和打回的记录才可以修改！');
					return;
				}

				cafc.load(record);
				cawc.show();
			},
			del : function() {

				var cawc = cf.getC('cawc');
				var cafc = cf.getC('cafc');

				var record = [this.getSelectedRecord()];
				if (!record) {
					alert('请先选择一条记录！');
					return;
				}

				var status = record[0].get("status");
				if (!((status == 0) || (status == 4))) {
					alert('只有保存和打回的记录才可以修改！');
					return;
				}

				var idList = this.getSelectIdList(record);

				var s = cf.getC('s');

				var para = {
					resource : 'customer.do',
					act : 'd',
					params : {
						idList : Ext.encode(idList)
					},
					cbf : this.delSuccess,
					scope : this
				};
				s.request(para);

			},
			exp : function() {

				var s = cf.getC('s');

				var url = s.getUrl({
							resource : 'customer.do'
						});

				url = url + '?m=readExcel'

				window.open(url);
			},
			showDetail : function() {

				var record = this.getSelectedRecord();
				if (!record) {
					alert('请先选择一条记录！');
					return;
				}

				var cswc = cf.getC('cswc');
				cswc.show(record.get('id'));
			},
			delSuccess : function(response) {
				var cigc = cf.getC('cigc');
				cigc.reload();
			},
			load : function() {

				var store = this.store;
				store.baseParams = {
					readtype : 'read'
				};
				store.load({
							params : {
								start : 0,
								limit : 29
							}
						});
			},
			afterBulidComponent : function() {
				this.cmp.on('rowclick', this.rowclick, this);
			},
			rowclick : function(g, i, e) {

				var record = this.getRecord(i);
				var cngc = cf.getC('cngc');
				cngc.load(record.get('id'));

			}

		});
